<template>

	<h1>用户登录</h1>
	<span>用户名:</span><input type="text" v-model="username"/><br />
	<span>密&nbsp&nbsp&nbsp码:</span><input type="password" v-model="password"/><br />
	<button @click="onLoginClick">登录</button>
	<button @click="signupClick">注册</button>
</template>
<script>
import { useRouter } from 'vue-router'
	export default{
		data() {
			return{
				username:"",
				password:"",
				router:useRouter()
			}
		},
		methods:{
			onLoginClick(){
				if (this.username=="cyc"&&this.password=="20020214") {
					this.router.push("/index")
				}else{
					alert("username/password ERROR")
				}
			},
			signupClick(){
				this.router.push("/Signup")
			}
		}
	}
</script>

<style>
</style>